package com.example.springboot.security.controller;

import com.example.springboot.security.util.SecurityUtils;
import org.springframework.web.bind.annotation.*;

/**
 * @author lei yu
 * @date 2024/05/20
 */
@RestController
@RequestMapping("/security")
public class SecurityController {

    //    @PermitAll
    @PostMapping("/login")
    public String login() {
        // 验证用户
        // ... ...
        return SecurityUtils.setToken();
    }

    @GetMapping("/echo")
    public String echo() {
        return "echo";
    }

    @GetMapping("/home")
    public String home() {
        return "我是首页";
    }

}
